package com.zhitong.money.util;

import com.zhitong.money.util.api.ITellerIdConfig;
import com.zhitong.money.util.api.ITellerIdGenerator;

import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 *
 * Description: tid的基础生成器
 * date: 2021/1/24 22:58
 *
 * @author Andy Zhang
 * @since JDK 1.8
 */
public class DefaultTellerIdGenerator implements ITellerIdGenerator {

//    生成器的配置
    private ITellerIdConfig tellerIdConfig;
//    读写锁,防止并发问题的出现
    private ReentrantReadWriteLock reentrantReadWriteLock;

    public DefaultTellerIdGenerator(){
        this.tellerIdConfig=new DefaultTellerIdConfig();
        this.reentrantReadWriteLock=new ReentrantReadWriteLock();
    }

    public DefaultTellerIdGenerator(ITellerIdConfig config){
        this.tellerIdConfig=config;
        this.reentrantReadWriteLock=new ReentrantReadWriteLock();
    }

    @Override
    public String next() {

        return null;
    }
}
